package com.example.barcodeapp.persenter;

import com.example.barcodeapp.base.BasePersenter;
import com.example.barcodeapp.common.CommonSubscriber;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.model.HttpManager;
import com.example.barcodeapp.ui.home.bean.JiaoShiNeiRongBean;
import com.example.barcodeapp.ui.own.bean.PeiLianKeBean;
import com.example.barcodeapp.utils.RxUtils;

public class OnePresenterPeilianke extends BasePersenter<IOwn.Viewkechengpeilianke> implements IOwn.Persenterkechengpeilianke {
    @Override
    public void getPeilianKe(int l_id, int lc_id, int cc_id, int page, int search, int uid) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getpeilianke(cc_id,page,search)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<PeiLianKeBean>(mView) {
                    @Override
                    public void onNext(PeiLianKeBean hanFuDaBean) {
                        mView.getPeilianKe(hanFuDaBean);
                    }
                }));
    }

    @Override
    public void getPeilianKe(int l_id, int lc_id, int page) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getpeilianke(l_id,lc_id,page)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<PeiLianKeBean>(mView) {
                    @Override
                    public void onNext(PeiLianKeBean hanFuDaBean) {
                        mView.getPeilianKe(hanFuDaBean);
                    }
                }));
    }
}
